package com.springboot.java0317springboot.iocdemo;

/**
 * @author lenovo
 * @Description
 * @Date2025-3-17 15:44
 */
public class ComputerTest {
    public static void main(String[] args){
        //硬编码方式创建对象
        Cpu cpu = new AMDCpu();
        Memory memory = new SumsungMemory();
        Air air=new Aira();
        TV tv = new TCLTV();
        //设置电脑属性
        Computer computer = new Computer();
        computer.setCpu(cpu);
        computer.setMemory(memory);
        computer.setBrand("华为");
        computer.setAir(air);
        computer.setTv(tv);

        //开机
        computer.start();
    }
}
